<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <img src="常用鼠标事件.png" alt="">
    <br>
    <div>这是一段可以禁止文字复制的文字</div>
    <script>
        // contextmenu 可以禁用右键菜单
        document.addEventListener('contextmenu', function(e) {
            // 阻止整个文档的右键菜单
            e.preventDefault();
        });
        // 禁止选中文字 selectstart
        document.addEventListener('selectstart', function(e) {
            e.preventDefault();
        });
    </script>
</body>

</html>